inkmap-mcp 0.3.18 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +4 -2
- package/README.md +2 -1
- package/dist/bundles/antigravity/plugin.json +1 -1
- package/dist/bundles/antigravity/sidecars/inkmap/main.mjs +113 -28
- package/dist/bundles/codex/inkmap-codex/.codex-plugin/plugin.json +1 -1
- package/dist/bundles/codex/inkmap-codex/plugin.json +1 -1
- package/dist/bundles/harness/client.js +3 -0
- package/dist/bundles/harness/host.js +138 -52
- package/dist/bundles/harness/package.json +1 -1
- package/dist/bundles/vscode/dist/extension.js +215 -101
- package/dist/bundles/vscode/package.json +1 -1
- package/dist/cli.cjs +318 -211
- package/dist/codex.html +526 -525
- package/dist/web/app.js +50014 -49912
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
### 5. 隐私
|
|
28
28
|
|
|
29
|
-
-
|
|
29
|
+
- 本软件不收集、不上传你的文档内容、文件名或路径。
|
|
30
|
+
- 为了解各客户端和功能的使用情况,本软件会向 `zhiyuanv.com` 发送匿名使用统计:随机生成的安装标识、软件版本、所在客户端、操作系统类型、界面语言、试用或 Pro 状态,以及打开、编辑和各项功能的使用次数。服务器在收到统计时会记录来源 IP 地址,用于识别重复设备和判断所在地区。
|
|
30
31
|
- 平台会话凭证保存在编辑器的机密存储中,命令行工具保存在 `~/.inkmap/billing-session` 中。
|
|
31
32
|
- 购买时的付款信息由支付平台处理,我们只能看到订单号、商品和联系方式等平台提供的信息,用于确认支付、发放权益和售后。
|
|
32
33
|
|
|
@@ -68,7 +69,8 @@ Within 7 days of purchase you can ask for a full refund through the store, no qu
|
|
|
68
69
|
|
|
69
70
|
### 5. Privacy
|
|
70
71
|
|
|
71
|
-
- The Software never collects or uploads your documents
|
|
72
|
+
- The Software never collects or uploads your documents, their file names or their paths.
|
|
73
|
+
- To understand how each client and feature is used, the Software sends anonymous usage statistics to `zhiyuanv.com`: a randomly generated installation ID, the Software version, the client it runs in, the operating system type, the interface language, whether it is in trial or Pro, and how many times documents were opened or edited and features were used. When it receives them, the server records the source IP address, which is used to recognise duplicate devices and the region.
|
|
72
74
|
- The platform session is stored in the editor’s secret storage or in `~/.inkmap/billing-session` for the CLI.
|
|
73
75
|
- Payments are handled by the payment platform. We only see what it shares — order number, product and contact details — and use it to confirm payments, grant access and provide support.
|
|
74
76
|
|
package/README.md
CHANGED
|
@@ -18,7 +18,8 @@ npx -y inkmap-mcp@latest install
|
|
|
18
18
|
|
|
19
19
|
| Platform / Client | CLI Target Command | How to Open Inkmap |
|
|
20
20
|
| :--- | :--- | :--- |
|
|
21
|
-
| **Cursor / VS Code /
|
|
21
|
+
| **Cursor / VS Code / Windsurf** | `npx -y inkmap-mcp@latest install cursor` (or `vscode` / `windsurf`) | Click the top-right **Mindmap icon** on any `.md` file, or right-click -> **Open as Inkmap** |
|
|
22
|
+
| **TRAE** (not yet listed in TRAE's own marketplace) | International: `npx -y inkmap-mcp@latest install trae`. TRAE CN: download [`inkmap.vsix`](https://github.com/zhiyuanvision-lang/InkMap/releases/latest/download/inkmap.vsix) and choose **Install from VSIX** in the Extensions view | Same as above |
|
|
22
23
|
| **DeepSeek Harness** | `npx -y inkmap-mcp@latest install deepseek` | Preview any `.md` file and click **Inkmap** in the top-right preview toolbar |
|
|
23
24
|
| **Claude Desktop / Claude Code** | `npx -y inkmap-mcp@latest install claude` | Ask Claude: *"Open `README.md` with Inkmap"* |
|
|
24
25
|
| **OpenAI Codex / Antigravity** | `npx -y inkmap-mcp@latest install codex` | Ask the agent to open any `.md` outline in Inkmap (or select **Inkmap Mind Map**) |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inkmap",
|
|
3
3
|
"displayName": "Inkmap — Markdown Mind Map & Mermaid 思维导图",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.19",
|
|
5
5
|
"description": "Interactive two-way Markdown (.md, .markmap.md) mind map, mindmap, markmap, Mermaid flowchart, diagram, XMind outline & KaTeX editor: auto-opens in the Antigravity side pane with live file write-back. 在右侧面板实时双向编辑 Markdown 思维导图、脑图、流程图、大纲、架构图、组织结构图与鱼骨图。",
|
|
6
6
|
"logo": "assets/logo.svg",
|
|
7
7
|
"homepage": "https://zhiyuanv.com/software.html",
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { execFile } from "node:child_process";
|
|
3
3
|
import { createHash as createHash2 } from "node:crypto";
|
|
4
4
|
import { readFileSync, readdirSync } from "node:fs";
|
|
5
|
-
import { lstat as lstat3, readFile as readFile4, realpath as
|
|
5
|
+
import { lstat as lstat3, readFile as readFile4, realpath as realpath4 } from "node:fs/promises";
|
|
6
6
|
import { homedir as homedir4 } from "node:os";
|
|
7
|
-
import { basename as basename3, dirname as dirname4, extname as extname2, join as
|
|
7
|
+
import { basename as basename3, dirname as dirname4, extname as extname2, join as join5, normalize as normalize2, relative as relative3 } from "node:path";
|
|
8
8
|
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
|
|
9
9
|
|
|
10
10
|
// packages/core/dist/product.js
|
|
@@ -29,6 +29,52 @@ function hasAccess(state, now = Date.now()) {
|
|
|
29
29
|
return state.pro || (state.trialUntil ?? 0) > now;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// packages/core/dist/images.js
|
|
33
|
+
var MAX_IMAGE_BYTES = 10 * 1024 * 1024;
|
|
34
|
+
var startsWith = (bytes, signature, offset = 0) => [...signature].every((char, i) => bytes[offset + i] === char.charCodeAt(0));
|
|
35
|
+
function sniffImage(bytes) {
|
|
36
|
+
if (startsWith(bytes, "\x89PNG\r\n\n"))
|
|
37
|
+
return "png";
|
|
38
|
+
if (startsWith(bytes, "\xFF\xD8\xFF"))
|
|
39
|
+
return "jpg";
|
|
40
|
+
if (startsWith(bytes, "GIF87a") || startsWith(bytes, "GIF89a"))
|
|
41
|
+
return "gif";
|
|
42
|
+
if (startsWith(bytes, "RIFF") && startsWith(bytes, "WEBP", 8))
|
|
43
|
+
return "webp";
|
|
44
|
+
return void 0;
|
|
45
|
+
}
|
|
46
|
+
function decodeImageDataUrl(dataUrl) {
|
|
47
|
+
const match = typeof dataUrl === "string" ? /^data:[\w.+/-]*;base64,([A-Za-z0-9+/]*={0,2})$/.exec(dataUrl) : null;
|
|
48
|
+
if (!match)
|
|
49
|
+
return { problem: "type" };
|
|
50
|
+
if (match[1].length * 3 / 4 - 2 > MAX_IMAGE_BYTES)
|
|
51
|
+
return { problem: "size" };
|
|
52
|
+
let binary;
|
|
53
|
+
try {
|
|
54
|
+
binary = atob(match[1]);
|
|
55
|
+
} catch {
|
|
56
|
+
return { problem: "type" };
|
|
57
|
+
}
|
|
58
|
+
if (binary.length > MAX_IMAGE_BYTES)
|
|
59
|
+
return { problem: "size" };
|
|
60
|
+
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
61
|
+
const extension = sniffImage(bytes);
|
|
62
|
+
return extension ? { bytes, extension } : { problem: "type" };
|
|
63
|
+
}
|
|
64
|
+
function imageFolderName(documentFileName) {
|
|
65
|
+
const stem = documentFileName.replace(/\.(?:md|markdown)$/i, "").trim();
|
|
66
|
+
return `${/^\.*$/.test(stem) ? "images" : stem}.assets`;
|
|
67
|
+
}
|
|
68
|
+
function imageFileName(when, extension, attempt = 1) {
|
|
69
|
+
const two = (n) => String(n).padStart(2, "0");
|
|
70
|
+
const stamp = `${when.getFullYear()}${two(when.getMonth() + 1)}${two(when.getDate())}-${two(when.getHours())}${two(when.getMinutes())}${two(when.getSeconds())}`;
|
|
71
|
+
return `image-${stamp}${attempt > 1 ? `-${attempt}` : ""}.${extension}`;
|
|
72
|
+
}
|
|
73
|
+
function imageLinkPath(folder, file) {
|
|
74
|
+
const encode = (part) => part.replace(/[%\s()<>#?[\]\\"]/g, (char) => encodeURIComponent(char).replace(/\(/g, "%28").replace(/\)/g, "%29"));
|
|
75
|
+
return `${encode(folder)}/${encode(file)}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
32
78
|
// packages/core/dist/index.js
|
|
33
79
|
function sanitizeViewState(raw) {
|
|
34
80
|
if (!raw || typeof raw !== "object")
|
|
@@ -62,7 +108,7 @@ import { homedir, tmpdir } from "node:os";
|
|
|
62
108
|
import { dirname, join } from "node:path";
|
|
63
109
|
|
|
64
110
|
// packages/cli/dist/version.js
|
|
65
|
-
var INKMAP_VERSION = "0.3.
|
|
111
|
+
var INKMAP_VERSION = "0.3.19";
|
|
66
112
|
|
|
67
113
|
// packages/cli/dist/license.js
|
|
68
114
|
var ZH_LOCALE_RE = /^zh(?:[-_.]|$)/i;
|
|
@@ -1173,10 +1219,14 @@ async function openBrowserWindow(url) {
|
|
|
1173
1219
|
// packages/cli/dist/server.js
|
|
1174
1220
|
import { createHash, randomBytes } from "node:crypto";
|
|
1175
1221
|
import { watch } from "node:fs";
|
|
1176
|
-
import { lstat as lstat2, mkdir as
|
|
1222
|
+
import { lstat as lstat2, mkdir as mkdir3, readFile as readFile3, realpath as realpath3, rename as rename2, rm as rm2, stat, writeFile as writeFile3 } from "node:fs/promises";
|
|
1177
1223
|
import { createServer } from "node:http";
|
|
1178
1224
|
import { homedir as homedir3 } from "node:os";
|
|
1179
|
-
import { basename as basename2, delimiter as delimiter2, dirname as dirname3, extname, join as
|
|
1225
|
+
import { basename as basename2, delimiter as delimiter2, dirname as dirname3, extname, join as join4, normalize, relative as relative2, resolve as resolve2, sep as sep2 } from "node:path";
|
|
1226
|
+
|
|
1227
|
+
// packages/cli/dist/image-assets.js
|
|
1228
|
+
import { mkdir as mkdir2, realpath as realpath2, writeFile as writeFile2 } from "node:fs/promises";
|
|
1229
|
+
import { join as join3 } from "node:path";
|
|
1180
1230
|
|
|
1181
1231
|
// packages/cli/dist/workspace-fs.js
|
|
1182
1232
|
import { lstat, readdir, readFile as readFile2, realpath } from "node:fs/promises";
|
|
@@ -1454,6 +1504,27 @@ function createWorkspaceAccess() {
|
|
|
1454
1504
|
return { allowedRoots, assertAllowedFile };
|
|
1455
1505
|
}
|
|
1456
1506
|
|
|
1507
|
+
// packages/cli/dist/image-assets.js
|
|
1508
|
+
async function saveImageAsset(documentDir, documentFileName, image, when = /* @__PURE__ */ new Date()) {
|
|
1509
|
+
const folder = imageFolderName(documentFileName);
|
|
1510
|
+
const target = join3(documentDir, folder);
|
|
1511
|
+
await mkdir2(target, { recursive: true });
|
|
1512
|
+
if (!insideOrEqual(await realpath2(documentDir), await realpath2(target))) {
|
|
1513
|
+
throw new Error(say("\u56FE\u7247\u76EE\u5F55\u6307\u5411\u6587\u6863\u76EE\u5F55\u4E4B\u5916\uFF0C\u672A\u4FDD\u5B58\u56FE\u7247\u3002", "The pictures folder leads outside the document's folder, so nothing was saved."));
|
|
1514
|
+
}
|
|
1515
|
+
for (let attempt = 1; attempt <= 100; attempt++) {
|
|
1516
|
+
const name = imageFileName(when, image.extension, attempt);
|
|
1517
|
+
try {
|
|
1518
|
+
await writeFile2(join3(target, name), image.bytes, { flag: "wx" });
|
|
1519
|
+
return imageLinkPath(folder, name);
|
|
1520
|
+
} catch (error) {
|
|
1521
|
+
if (error.code !== "EEXIST")
|
|
1522
|
+
throw error;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
throw new Error(say("\u65E0\u6CD5\u4E3A\u56FE\u7247\u751F\u6210\u65B0\u7684\u6587\u4EF6\u540D\u3002", "Could not find a free file name for the picture."));
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1457
1528
|
// packages/cli/dist/server.js
|
|
1458
1529
|
var MAX_BODY = 20 * 1024 * 1024;
|
|
1459
1530
|
var TYPES = {
|
|
@@ -1487,8 +1558,8 @@ function docName(path) {
|
|
|
1487
1558
|
return basename2(path).replace(/\.md$/i, "").replace(/\.markmap$/i, "");
|
|
1488
1559
|
}
|
|
1489
1560
|
function viewStateFile(key) {
|
|
1490
|
-
const base = process.env.INKMAP_HOME ||
|
|
1491
|
-
return
|
|
1561
|
+
const base = process.env.INKMAP_HOME || join4(homedir3(), ".inkmap");
|
|
1562
|
+
return join4(base, "view-state", hash(key) + ".json");
|
|
1492
1563
|
}
|
|
1493
1564
|
async function readDiskViewState(key) {
|
|
1494
1565
|
try {
|
|
@@ -1499,10 +1570,10 @@ async function readDiskViewState(key) {
|
|
|
1499
1570
|
}
|
|
1500
1571
|
async function writeDiskViewState(key, state) {
|
|
1501
1572
|
const target = viewStateFile(key);
|
|
1502
|
-
await
|
|
1573
|
+
await mkdir3(dirname3(target), { recursive: true, mode: 448 });
|
|
1503
1574
|
const temp = `${target}.${process.pid}.${Date.now()}`;
|
|
1504
1575
|
try {
|
|
1505
|
-
await
|
|
1576
|
+
await writeFile3(temp, JSON.stringify(state), { mode: 384 });
|
|
1506
1577
|
await rename2(temp, target);
|
|
1507
1578
|
} finally {
|
|
1508
1579
|
await rm2(temp, { force: true }).catch(() => {
|
|
@@ -1511,7 +1582,7 @@ async function writeDiskViewState(key, state) {
|
|
|
1511
1582
|
}
|
|
1512
1583
|
async function fileSource(file, log = () => {
|
|
1513
1584
|
}) {
|
|
1514
|
-
const path = await
|
|
1585
|
+
const path = await realpath3(resolve2(file)).catch(() => resolve2(file));
|
|
1515
1586
|
if (!(await stat(path)).isFile())
|
|
1516
1587
|
throw new Error(`\u4E0D\u662F\u6587\u4EF6\uFF1A${path}`);
|
|
1517
1588
|
const dir = dirname3(path);
|
|
@@ -1521,7 +1592,7 @@ async function fileSource(file, log = () => {
|
|
|
1521
1592
|
dir,
|
|
1522
1593
|
read: () => readFile3(path, "utf8"),
|
|
1523
1594
|
async write(md) {
|
|
1524
|
-
await
|
|
1595
|
+
await writeFile3(path, md, "utf8");
|
|
1525
1596
|
log(`\u5DF2\u5199\u56DE ${path}`);
|
|
1526
1597
|
},
|
|
1527
1598
|
watch(onChange) {
|
|
@@ -1551,7 +1622,7 @@ function within(root, rel, allowAbsoluteInRoot = false) {
|
|
|
1551
1622
|
}
|
|
1552
1623
|
const resolvedRoot = resolve2(root);
|
|
1553
1624
|
const base = resolvedRoot.endsWith(sep2) ? resolvedRoot : resolvedRoot + sep2;
|
|
1554
|
-
const full = allowAbsoluteInRoot && /^(?:[\\/]|[A-Za-z]:[\\/])/.test(decoded) ? normalize(decoded) : normalize(
|
|
1625
|
+
const full = allowAbsoluteInRoot && /^(?:[\\/]|[A-Za-z]:[\\/])/.test(decoded) ? normalize(decoded) : normalize(join4(resolvedRoot, decoded));
|
|
1555
1626
|
return full.startsWith(base) ? full : null;
|
|
1556
1627
|
}
|
|
1557
1628
|
async function serve({ source: initialSource, webRoot, port = 4377, host = "127.0.0.1", log = () => {
|
|
@@ -1609,17 +1680,17 @@ data: ${JSON.stringify(data)}
|
|
|
1609
1680
|
}), 80);
|
|
1610
1681
|
};
|
|
1611
1682
|
let unwatch = activeSource.watch(scheduleRefresh);
|
|
1612
|
-
const canonicalActiveKey = async () => activeSource.key ? await
|
|
1683
|
+
const canonicalActiveKey = async () => activeSource.key ? await realpath3(activeSource.key).catch(() => activeSource.key) : void 0;
|
|
1613
1684
|
async function collectWorkspaceFiles() {
|
|
1614
1685
|
const roots = /* @__PURE__ */ new Map();
|
|
1615
1686
|
if (activeSource.key && !confineToWorkspaceRoots) {
|
|
1616
|
-
const realKey = await
|
|
1617
|
-
const projRoot = await
|
|
1687
|
+
const realKey = await realpath3(activeSource.key).catch(() => activeSource.key);
|
|
1688
|
+
const projRoot = await realpath3(await findProjectRoot(realKey)).catch(() => dirname3(realKey));
|
|
1618
1689
|
roots.set(projRoot, { path: projRoot, name: basename2(projRoot), active: true });
|
|
1619
1690
|
}
|
|
1620
1691
|
const envRoots = [...workspaceRoots, ...(process.env.INKMAP_WORKSPACES || "").split(delimiter2)].filter(Boolean);
|
|
1621
1692
|
for (const raw of envRoots) {
|
|
1622
|
-
const real = await
|
|
1693
|
+
const real = await realpath3(resolve2(raw)).catch(() => null);
|
|
1623
1694
|
if (real && !roots.has(real)) {
|
|
1624
1695
|
roots.set(real, { path: real, name: basename2(real), active: roots.size === 0 });
|
|
1625
1696
|
}
|
|
@@ -1657,7 +1728,7 @@ data: ${JSON.stringify(data)}
|
|
|
1657
1728
|
throw notMarkdown();
|
|
1658
1729
|
const resolvedCandidate = resolve2(candidatePath);
|
|
1659
1730
|
const rawStat = await lstat2(resolvedCandidate).catch(() => null);
|
|
1660
|
-
const realTarget = await
|
|
1731
|
+
const realTarget = await realpath3(resolvedCandidate).catch(() => null);
|
|
1661
1732
|
const targetStat = realTarget ? await stat(realTarget).catch(() => null) : null;
|
|
1662
1733
|
if (!rawStat || rawStat.isSymbolicLink() && !trustCaller || !realTarget || !targetStat?.isFile() || targetStat.size > MAX_MARKDOWN_BYTES) {
|
|
1663
1734
|
throw new HttpError(403, zh() ? "\u8BF7\u9009\u62E9 5 MiB \u4EE5\u5185\u7684\u666E\u901A Markdown \u6587\u4EF6\u3002" : "Choose a regular Markdown file up to 5 MiB.");
|
|
@@ -1812,6 +1883,20 @@ data: ${JSON.stringify(data)}
|
|
|
1812
1883
|
return json(res, 200, { version });
|
|
1813
1884
|
});
|
|
1814
1885
|
}
|
|
1886
|
+
if (url.pathname === "/api/image" && req.method === "POST") {
|
|
1887
|
+
if (!sameOriginWrite())
|
|
1888
|
+
return json(res, 403, { error: "forbidden" });
|
|
1889
|
+
const image = decodeImageDataUrl(JSON.parse(await readBody(req)).dataUrl);
|
|
1890
|
+
if ("problem" in image) {
|
|
1891
|
+
return json(res, image.problem === "size" ? 413 : 415, { error: image.problem });
|
|
1892
|
+
}
|
|
1893
|
+
if (!hasAccess(await license?.state() ?? { pro: false }))
|
|
1894
|
+
return json(res, 403, { error: "Inkmap trial expired" });
|
|
1895
|
+
return await serialized(async () => {
|
|
1896
|
+
const name = activeSource.key ? basename2(activeSource.key) : activeSource.name;
|
|
1897
|
+
return json(res, 200, { path: await saveImageAsset(activeSource.dir, name, image) });
|
|
1898
|
+
});
|
|
1899
|
+
}
|
|
1815
1900
|
if (url.pathname === "/api/license" && req.method === "GET")
|
|
1816
1901
|
return json(res, 200, await license?.state({ forUi: true }) ?? { pro: false });
|
|
1817
1902
|
if (url.pathname === "/api/open" && req.method === "POST") {
|
|
@@ -1927,8 +2012,8 @@ data: ${JSON.stringify(data)}
|
|
|
1927
2012
|
if (url.pathname.startsWith("/doc-assets/")) {
|
|
1928
2013
|
let asset = within(activeSource.dir, url.pathname.slice("/doc-assets/".length), true);
|
|
1929
2014
|
if (asset) {
|
|
1930
|
-
const root = await
|
|
1931
|
-
asset = await
|
|
2015
|
+
const root = await realpath3(activeSource.dir).catch(() => null);
|
|
2016
|
+
asset = await realpath3(asset).catch(() => null);
|
|
1932
2017
|
const allowedExt = sidebar ? /\.(?:png|jpe?g|gif|webp|avif|bmp|ico)$/i : /\.(?:png|jpe?g|gif|webp|avif|bmp|ico|svg)$/i;
|
|
1933
2018
|
if (!root || !asset || !insideOrEqual(root, asset) || !allowedExt.test(asset))
|
|
1934
2019
|
asset = null;
|
|
@@ -1987,7 +2072,7 @@ data: ${JSON.stringify(data)}
|
|
|
1987
2072
|
|
|
1988
2073
|
// packages/antigravity/src/main.mjs
|
|
1989
2074
|
var __dirname = dirname4(fileURLToPath2(import.meta.url));
|
|
1990
|
-
var defaultWebRoot =
|
|
2075
|
+
var defaultWebRoot = join5(__dirname, "web");
|
|
1991
2076
|
var SidecarResponse = class {
|
|
1992
2077
|
constructor(body, { contentType = "text/plain", status = 200, headers } = {}) {
|
|
1993
2078
|
this.body = body;
|
|
@@ -2088,7 +2173,7 @@ function createAntigravitySidecar({
|
|
|
2088
2173
|
}
|
|
2089
2174
|
return { files: items, target };
|
|
2090
2175
|
}
|
|
2091
|
-
const rawHtml = readFileSync(
|
|
2176
|
+
const rawHtml = readFileSync(join5(webRoot, "index.html"), "utf8");
|
|
2092
2177
|
const cspMeta = `<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data: blob: https:; font-src 'self' data:; base-uri 'none'; form-action 'none'; object-src 'none'">`;
|
|
2093
2178
|
app.page("/", () => {
|
|
2094
2179
|
const osLoc = detectOsLocale();
|
|
@@ -2097,18 +2182,18 @@ function createAntigravitySidecar({
|
|
|
2097
2182
|
<script src="/preload.js"></script>
|
|
2098
2183
|
<script src="/bridge.js"></script>`);
|
|
2099
2184
|
});
|
|
2100
|
-
const bridgeJs = readFileSync(
|
|
2185
|
+
const bridgeJs = readFileSync(join5(__dirname, "bridge.js"), "utf8");
|
|
2101
2186
|
app.page("/bridge.js", () => bridgeJs);
|
|
2102
2187
|
app.api("/bridge.js", () => new SidecarResponse(bridgeJs, { contentType: "application/javascript; charset=utf-8" }), "GET");
|
|
2103
2188
|
let preloadedAppJs = null;
|
|
2104
2189
|
try {
|
|
2105
|
-
preloadedAppJs = readFileSync(
|
|
2190
|
+
preloadedAppJs = readFileSync(join5(webRoot, "app.js"), "utf8");
|
|
2106
2191
|
app.page("/app.js", () => preloadedAppJs);
|
|
2107
2192
|
} catch {
|
|
2108
2193
|
}
|
|
2109
2194
|
function registerStaticDir(dir, prefix = "") {
|
|
2110
2195
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
2111
|
-
const full =
|
|
2196
|
+
const full = join5(dir, entry.name);
|
|
2112
2197
|
const route = `${prefix}/${entry.name}`;
|
|
2113
2198
|
if (entry.isDirectory()) {
|
|
2114
2199
|
registerStaticDir(full, route);
|
|
@@ -2313,11 +2398,11 @@ function createAntigravitySidecar({
|
|
|
2313
2398
|
const rel = typeof data?.path === "string" ? data.path.replace(/\?.*$/, "") : "";
|
|
2314
2399
|
if (!file || !rel) return notFound();
|
|
2315
2400
|
try {
|
|
2316
|
-
const dir = await
|
|
2401
|
+
const dir = await realpath4(dirname4(file));
|
|
2317
2402
|
const decoded = decodeURIComponent(rel);
|
|
2318
|
-
const candidate = /^(?:[\\/]|[A-Za-z]:[\\/])/.test(decoded) ? normalize2(decoded) : normalize2(
|
|
2403
|
+
const candidate = /^(?:[\\/]|[A-Za-z]:[\\/])/.test(decoded) ? normalize2(decoded) : normalize2(join5(dir, decoded));
|
|
2319
2404
|
if (!insideOrEqual(dir, candidate) || candidate === dir) return notFound();
|
|
2320
|
-
const realAsset = await
|
|
2405
|
+
const realAsset = await realpath4(candidate);
|
|
2321
2406
|
if (!insideOrEqual(dir, realAsset) || !/\.(?:png|jpe?g|gif|webp|avif|bmp|ico|svg)$/i.test(realAsset)) return notFound();
|
|
2322
2407
|
const info = await lstat3(realAsset);
|
|
2323
2408
|
if (!info.isFile() || info.size > MAX_MARKDOWN_BYTES) return notFound();
|
|
@@ -2350,7 +2435,7 @@ function createAntigravitySidecar({
|
|
|
2350
2435
|
}
|
|
2351
2436
|
if (process.env.ANTIGRAVITY_SIDECAR_WEB_PORT) {
|
|
2352
2437
|
const sdk = await import("sidecar_sdk").catch(
|
|
2353
|
-
() => import(pathToFileURL(
|
|
2438
|
+
() => import(pathToFileURL(join5(homedir4(), ".gemini", "config", "node_modules", "sidecar_sdk", "index.mjs")).href)
|
|
2354
2439
|
);
|
|
2355
2440
|
const { app } = createAntigravitySidecar({ app: new sdk.SidecarApp() });
|
|
2356
2441
|
app.run();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inkmap-codex",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19",
|
|
4
4
|
"description": "Interactive two-way Markdown mind map (markmap), Mermaid flowchart & XMind outline editor | 双向编辑 Markdown 思维导图、脑图、流程图与大纲",
|
|
5
5
|
"homepage": "https://zhiyuanv.com/software.html",
|
|
6
6
|
"repository": "https://github.com/zhiyuanvision-lang/InkMap",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "inkmap-codex",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.19",
|
|
5
5
|
"description": "Interactive two-way Markdown mind map (markmap), Mermaid flowchart & XMind outline editor | 双向编辑 Markdown 思维导图、脑图、流程图与大纲",
|
|
6
6
|
"homepage": "https://zhiyuanv.com/software.html",
|
|
7
7
|
"repository": "https://github.com/zhiyuanvision-lang/InkMap",
|
|
@@ -41,6 +41,9 @@ function billingFlowUrl(raw, origin, mode, legacy = false) {
|
|
|
41
41
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
42
42
|
var TRIAL_MS = 7 * DAY_MS;
|
|
43
43
|
|
|
44
|
+
// packages/core/dist/images.js
|
|
45
|
+
var MAX_IMAGE_BYTES = 10 * 1024 * 1024;
|
|
46
|
+
|
|
44
47
|
// packages/harness/src/shared.mjs
|
|
45
48
|
var packageName = true ? "dsh-inkmap" : "dsh-inkmap";
|
|
46
49
|
var kind = "inkmap-markdown";
|